www.gusucode.com > 地方成人教育中心整站源代码 1 > 地方成人教育中心整站源代码 1.0/manage/Login.asp

    <!--#include file="conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/sqlin.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="copyright" content="Copyright 2008 dananshan.com" />
<meta name="Author" content="闪电文章管理系统技术支持---www.dananshan.com" />
<meta name="Keywords" content="闪电文章管理系统文章管理系统" />
<meta name="Description" content="闪电文章管理系统文章管理系统" />
<title>后台登陆</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #15559f;
}
-->
</style></head>

<body>
<%
select case Request.QueryString("action")
case "logout"   '退出系统
	call logout()
case "login"
	call chklogin()
case else
    call main()
end select
sub main()
%>
<div style="position:absolute;top:35%;left:35%;z-index:1;">
<form id="form1" name="form1" method="post" action="?action=login">
	<table width="283" height="159" border="0" cellpadding="0" cellspacing="0" style="font-size:12px;">
	  <tr>
		<td colspan="2" valign="bottom" background="images/login.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td height="10" align="right">&nbsp;</td>
			<td>&nbsp;</td>
		  </tr>
          <tr>
			<td width="23%" height="30" align="right"><font color="#15559f"><strong>用户名:</strong></font></td>
			<td width="77%" align="left"><input name="uid" type="text" id="uid" class="input_style"></td>
		  </tr>
		  <tr>
			<td height="30" align="right"><font color="#15559f"><strong>密&nbsp;&nbsp;&nbsp;码:</strong></font></td>
			<td align="left"><input name="pwd" type="password" id="pwd" class="input_style"></td>
		  </tr>
          <tr>
			<td height="30" align="right"><font color="#15559f"><strong>验证码:</strong></font></td>
			<td align="left"><input name="yzm" type="text" id="yzm" class="input_style" style="width:100px;"><img src="../inc/code.asp" alt="验证码" /></td>
		  </tr>
		  <tr>
			<td height="30" align="right">&nbsp;</td>
			<td align="left"><input type="submit" name="Submit" value="提交" class="button1">
			  <input type="reset" name="Submit2" value="重置" class="button1"></td>
		  </tr>
          <tr>
			<td height="5" align="right"></td>
			<td></td>
		  </tr>
		</table></td>
	  </tr>
	  
	</table>
</form>
</div>
<%
end sub

sub logout()
	'清除Session中管理员身份的验证信息.
	session("usr")=""
	session("AdminPower")=""
	Response.Redirect "../Index.asp"
end sub

sub chklogin()
    call CheckPostUrl
	usr=replace(trim(request("uid")),"'","")
	pwd=replace(trim(request("pwd")),"'","")
	yzm=replace(trim(request("yzm")),"'","")
	if usr<>"" and pwd<>"" and yzm<>"" then
	    if Session("GetCode")<>yzm then
		  response.Write("<script>alert(""验证码错误。"");location.href=""login.asp"";</script>")
		else
		  sql="select * from Idea_Admin where UserName='"&usr&"' and Password='"&md5(pwd)&"'"
		  set rs=idea.exec(sql,1)
		  if not rs.eof then
			  if rs("Working") then
				  session("usr")=rs("UserName")
				  session("AdminPower")=rs("AdminPower")
				  response.Redirect("index.asp")
			  else
			  response.Write("<script>alert(""你的用户名已被锁定,你不能登陆!请联系管理员。"");location.href=""login.asp"";</script>")
			  end if	
		  else
			  response.Write("<script>alert(""您输入的用户名和密码不正确。"");location.href=""login.asp"";</script>")
			  response.end
		  end if
		  rs.close
		  set rs=nothing
		end if
	else
		response.Write("<script>alert(""请输入完整的用户名和密码。"");location.href=""login.asp"";</script>")
		response.end
	end if
end sub

sub  CheckPostUrl
      Dim Server_v1,Server_v2
      Server_v1 = CStr(Request.ServerVariables("HTTP_REFERER"))
      Server_v2 = CStr(Request.ServerVariables("SERVER_NAME"))
      If Mid(Server_v1,8,Len(Server_v2))<>Server_v2 Then	
	  	 response.write "<script>alert('不允许跨站提交');location.href='login.asp';</script>"
      End If
end sub
%>
</body>
</html>